#!/usr/bin/node
//main-module
const Radio = require('./03-radio');

const station = {
    freq: '106.7',
      name: 'music radio'

};

var radio = new Radio(station);

radio.on('open', (station) => {
    console.log('"%s" FM %s opened', station.name, station.freq);
      console.log('lalala...');

});
//对同一个事件不同的响应函数
radio.on('open',station=>{
  console.log('hello',station);
  console.log('eventNames:',radio.eventNames());
  console.log('open listener count:',radio.listenerCount('open'));
  console.log('open listener:',radio.listeners('open'));
})

radio.on('stop', (station) => {
    console.log('"%s" FM %s closed', station.name, station.freq);

});

